#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

ll qmi(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        res = res * a % mod;
        b >>= 1;
        a = a * a % mod;
    }
    return res;
}

void solve()
{
    int n;
    cin >> n;
    vector<pii>a(n);
    for(int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        a[i] = {x, y};
    }
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    ull t2 = LLONG_MAX;
    ull t1 = (ull)abs(x1 - x2) * abs(x1 - x2) + (ull)abs(y1 - y2) * abs(y1 - y2);
    for(int i = 0; i < n; i++)
    {   
        t2 = min(t2, (ull)abs(a[i].first - x2) * abs(a[i].first - x2) + (ull)abs(a[i].second - y2) * abs(a[i].second - y2));
        if(t2 <= t1)
        {
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << endl;
}

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}